<template>
  <div class="parentBox">
    <Parent :parentData="parentData.parent" v-if="parentData.parent" />
    <div class="Info">
      <div class="name">火星网友</div>
      <div class="date">2小时前</div>
      <div class="btn" @click="sendComment">回复</div>
    </div>
    <div class="mainContent">
      {{ parentData.content }}
    </div>
  </div>
</template>

<script>
import eventBus from "../../utils/eventBus";
export default {
  name: "Parent",
  props: ["parentData"],
  methods: {
    sendComment() {
      eventBus.$emit("sendMsg", this.parentData.id);
    },
  },
};
</script>

<style lang="less" scoped>
.parentBox {
  margin: 2px;
  padding: 3/360 * 100vw;
  border: 1px solid #e4e4e4;
  .Info {
    display: flex;
    align-items: center;
    .name {
      font-size: 16/360 * 100vw;
      color: #333;
    }
    .date {
      flex-grow: 1;
      font-size: 12/360 * 100vw;
      color: #888;
      padding-left: 10/360 * 100vw;
    }
    .btn {
      font-size: 14/360 * 100vw;
      color: #555;
    }
  }
  .mainContent {
    font-size: 16/360 * 100vw;
    padding: 10/360 * 100vw;
    color: #333;
  }
}
</style>